VTD/DMAR: free() correct pointer on error from acpi_parse_one_atsr()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 7 Jan 2014 13:59:31 +0000 (14:59 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 7 Jan 2014 13:59:31 +0000 (14:59 +0100)
commit62d33ca1048f4e08eaeb026c7b79239b4605b636
tree2e1404c21391c995f65ad531af458076e5e890bb
parenta9fe8c7dda440b84e178d65dcd64c0173b0a4b5d
VTD/DMAR: free() correct pointer on error from acpi_parse_one_atsr()

Free the allocated structure rather than the ACPI table ATS entry.

On further analysis, there is another memory leak.  acpi_parse_dev_scope()
could allocate scope->devices, and return with -ENOMEM.  All callers of
acpi_parse_dev_scope() would then free the underlying structure, loosing the
pointer.

These errors can only actually be reached through acpi_parse_dev_scope()
(which passes type = DMAR_TYPE), but I am quite surprised Coverity didn't spot
it.

Coverity-ID: 1146949
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/passthrough/vtd/dmar.c